package com.liangzhong.model.club
{
	import com.liangzhong.constants.ResourceConst;
	import com.liangzhong.manager.ResourceManager;
	import com.liangzhong.model.club.vo.NpcClubInfoVo;
	
	import flash.utils.Dictionary;

	/**
	 *npc 俱乐部信息管理 
	 * @author lake
	 * 
	 */	
	public class NpcClubDataManager
	{
		/**
		 *信息字典 
		 */		
		private var npcDic :Dictionary = new Dictionary();
		
		public function NpcClubDataManager()
		{
		}
		/**
		 *解析列表 
		 */		
		public function parseList():void
		{
			var xmlConfig:XML = ResourceManager.instance.getResource(ResourceConst.NPC_CLUB);
			if(xmlConfig == null)
			{
				return;
			}
			var vo :NpcClubInfoVo;
			for each(var item:XML in xmlConfig.tb_npc_club)
			{
				vo = new NpcClubInfoVo();
				vo.parse(item);
				npcDic[vo.cid] = vo;
			}
		}
		/**
		 *获取npc俱乐部通过id 
		 * @param cid
		 * @return 
		 * 
		 */		
		public function getNpcClubById(cid :int):NpcClubInfoVo
		{
			return npcDic[cid];
		}
	}
}